import React, { Component } from 'react'
import {ButtonWrapper} from './Count.style'

export default class Button extends Component {

  handleChange() {
    if (this.props.children === '+') {
      this.props.change(2)
    }else{
      this.props.change(-1)
    }
  }

  render() {
    return (
      // <button onClick={()=>this.props.change()}>
      //   {this.props.children}
      // </button>
      <ButtonWrapper bgColor={this.props.bg} onClick={() => this.handleChange()}>
        {this.props.children}
      </ButtonWrapper>
    )
  }
}
